<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSnsVideosTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sns_videos', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('sns_id')->index()->unsigned()->nullable();
            $table->string('video_name')->comment('视频名称');
            $table->string('video_url')->comment('视频地址');
            $table->timestamps();
            $table->foreign('sns_id')->references('id')->on('sns')->onDelete('cascade');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sns_videos');
    }
}
